/**
 * 
 */
package zeroj.web.validator.impl;

import zeroj.web.validator.IValidator;

/**
 * @author LYL(lyl at gmail dot com)
 *
 * @since 1.0
 *
 * 2008-9-30
 */
public class RegexValidator implements IValidator {

	private String pattern;
	
	public RegexValidator(String pattern) {
		
		this.pattern = pattern;
	}
	/* (non-Javadoc)
	 * @see zeroj.validator.IValidate#isValide(java.lang.String)
	 */
	public boolean isValid(String value) {
		
		return value.matches(pattern);
	}

}
